<?php
require_once("lib/db_connection.php");
$type_id = $_GET['type'];
$brand = $_GET['brand'];

$query_type = "SELECT value FROM lookup_fuel_tbl WHERE id='".$type_id."'";
$result_type = mysql_query($query_type) or die("SELECT FUEL TYPE ".mysql_error());
$row_type = mysql_fetch_array($result_type);
$type = $row_type['value'];

$query_price = "SELECT price FROM fuel_price_tbl WHERE company_id='".$_SESSION['company_id']."' AND brand='".$brand."' AND type='".$type."'";
$result_price = mysql_query($query_price) or die("SELECT PRICE ".mysql_error());
$row_price = mysql_fetch_array($result_price);

$price = $row_price['price'];
echo $price;
?>